<div class="widgets">

  <div class="row">
    <div class="col-xs-12">
      <ba-card baCardClass="with-scroll">
        <div class="section">
          <form (ngSubmit)="search()" class="form-horizontal search-form">
            <div class="form-group row">

              <div class="col-sm-5">
                <label for="idcard" class="col-sm-5 control-label">身份证</label>
                <div class="col-sm-7">
                  <input [(ngModel)]="searchForm.idcard" name="idcard" type="text"
                         class="form-control ">
                </div>
              </div>

              <div class="col-sm-5">
                <label for="name"
                       class="col-sm-5 control-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</label>
                <div class="col-sm-7">
                  <input [(ngModel)]="searchForm.name" name="name" type="text"
                         class="form-control">
                </div>
              </div>

            </div>

            <div class="form-group row">

              <div class="col-sm-5">
                <label for="companyname" class="col-sm-5 control-label">企业名</label>
                <div class="col-sm-7">
                  <input [(ngModel)]="searchForm.companyname" name="name" type="text"
                         class="form-control">
                </div>
              </div>

              <div class="col-sm-5">
                <label for="verified" class="col-sm-5 control-label">申请状态</label>
                <div class="col-sm-7">
                  <select [(ngModel)]="searchForm.verified" name="verified" type="text"
                          class="form-control ">
                    <option value="待审核" selected>待审核</option>
                    <option value="通过">通过</option>
                    <option value="未通过">未通过</option>
                    <option value="">全部</option>
                  </select>
                </div>
              </div>
            </div>

            <div class="form-group row">
              <div class="col-sm-5">
                <label id="publishTimeLabel" class="col-sm-5 control-label" for="startdate">时间段</label>

                <div class="col-sm-7" id="publishTimeCol">
                  <date-range-picker (onSelected)="updateDateRange($event)"></date-range-picker>
                </div>
              </div>

              <div class="col-sm-5"></div>

              <div class="col-sm-2">
                <button type="submit" class="btn btn-primary pull-left"><i class="fa fa-search" aria-hidden="true"></i>
                  查询
                </button>
              </div>
            </div>

          </form>
        </div>
        <div class="section btn-section btn-toolbar">
          <a role="button" class="btn btn-primary btn-review" [ngClass]="{'disabled': disableReviewBtn}"
             (click)="review()">查看</a>
          <a role="button" class="btn btn-success btn-review" [ngClass]="{'disabled': disablePassBtn}"
             (click)="showPassModal()">通过</a>
          <a role="button" class="btn btn-danger btn-reject" [ngClass]="{'disabled': disableRejectBtn}"
             (click)="showRejectModal()">驳回</a>
          <a role="button" class="btn btn-danger btn-reject" [ngClass]="{'disabled': disableDeleteBtn}"
             (click)="showDeleteModal()">删除</a>
          <span *ngIf="errorShow">请重新登录</span>
        </div>
        <div class="section">
          <data-tables [searchParams]="searchForm" [config]="dataTablesConfig"
                       (onSelect)="tableRowSelect($event)" (onError)="handleError($event)"></data-tables>
        </div>
      </ba-card>
    </div>
  </div>
</div>

<div bsModal #apprDeleteModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprDeleteClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">删除</h4>
      </div>

      <div class="modal-body">
        确定要删除吗
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="delete()">删除</button>
        <button class="btn btn-default" (click)="apprDeleteClose()">取消</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprPassModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprPassClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">审核通过</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="form-group">
            <label for="textarea01">审核意见</label>
            <textarea class="form-control" #passComment></textarea>
            <span *ngIf="_errorMsg">{{_errorMsg}}</span>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="pass(passComment.value)">提交</button>
        <button class="btn btn-default" (click)="apprPassClose()">取消</button>
      </div>
    </div>
  </div>
</div>

<div bsModal #apprRejectModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprRejectClose()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">审核驳回</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <div class="form-group">
            <label for="textarea01">审核意见</label>
            <textarea class="form-control" #rejcetComment></textarea>
            <span *ngIf="_errorMsg">{{_errorMsg}}</span>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-primary confirm-btn" (click)="reject(rejcetComment.value)">提交</button>
        <button class="btn btn-default" (click)="apprRejectClose()">取消</button>
      </div>
    </div>
  </div>
</div>


<div bsModal #apprReviewModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="entRegApprModalLabel"
     aria-hidden="true" (onHide)="onHideModal()">
  <div class="modal-dialog modal-lg">
    <div class="modal-content" style="color: #000;">
      <div class="modal-header">
        <button class="close" (click)="apprReviewModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">详情</h4>
      </div>

      <div class="modal-body">
        <div class="auth-block">
          <form class="form-horizontal" *ngIf="_selectdAppr">
            <div class="form-group row"><label class="col-sm-2 form-control-label">姓名</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.name}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">身份证号码</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.idcard}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">性别</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.sex}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">邮箱</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.email}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">出生年月</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.birthday}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">专业</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.speciality}}"></div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">毕业学校</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.schoolname}}"></div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">毕业时间</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.finishschooldate}}"></div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">民族</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.folk}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">政治面貌</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.government}}"></div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">联系电话</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.telephone}}"></div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">联系地址</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.address}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">邮政编码</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.postcode}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">学历</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.education}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">公司名称</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.companyname}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">技术职称</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.technicaltitles}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">详细地址</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.addressinfo}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">提交时间</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.submittime}}">
              </div>
            </div>
            <div class="form-group row"><label class="col-sm-2 form-control-label">审核状态</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly value="{{_selectdAppr.verified}}">
              </div>
            </div>
            <div class="form-group row" *ngIf="_selectdAppr.verified != '待审核'"><label
              class="col-sm-2 form-control-label">审核时间</label>
              <div class="col-sm-10"><input type="text" class="form-control" readonly
                                            value="{{_selectdAppr.verifytime}}">
              </div>
            </div>
            <div class="form-group row" *ngIf="_selectdAppr.verified != '待审核'"><label
              class="col-sm-2 form-control-label">审核意见</label>
              <div class="col-sm-10"><input type="text" class="form-control"
                                            [value]="_selectdAppr.verifydescription" readonly>
              </div>
            </div>
            <div class="form-group row" *ngIf="_selectdAppr.verified === '待审核'">
              <label for="textarea01" class="col-sm-2 form-control-label">审核意见</label>
              <div class="col-sm-10">
                <textarea class="form-control" #CheckComment></textarea>
                <a role="button" class="btn btn-success btn-pass check" (click)="pass(CheckComment.value)">通过</a>
                <a role="button" class="btn btn-danger btn-reject check" (click)="reject(CheckComment.value)">驳回</a>
              </div>
            </div>
          </form>

        </div>
      </div>

      <div class="modal-footer">
        <button class="btn btn-default" (click)="apprReviewModal.hide()">关闭</button>
      </div>
    </div>
  </div>
</div>
